def fn(a,n):
    sum,a1 = a,a
    for i in range(n-1):
        a = a*10+a1
        sum += a
    return sum
a,b=input().split()
s=fn(int(a),int(b))
print(s)